// import { folderAdd_status } from "./buttonStatus";
/**
 * 按钮权限
 */
interface IButtonGroup {
  title: string;
  icon: string;
  list: IButtonList[];
}
interface IButtonList {
  title: string;
  icon: string;
  disabled: boolean;
  show: boolean;
  alias: string;
  iconfontIcon?: string;
}
// 父级按钮集合
export const buttonList: (IButtonList | IButtonGroup)[] = [
  {
    title: "常用操作",
    icon: "Operation",
    list: [
      { title: "批量挂接全文", icon: "Link", disabled: true, show: true, alias: "批量挂接全文" },
      { title: "轨迹查看", icon: "MapLocation", disabled: true, show: true, alias: "轨迹查看" },
      { title: "OCR", icon: "Ticket", disabled: true, show: true, alias: "OCR" },
      { title: "权限管理", icon: "Management", disabled: true, show: true, alias: "权限管理" },
      { title: "离线挂接", icon: "Download", disabled: true, show: true, alias: "离线挂接" },
      { title: "标记备注", icon: "Flag", disabled: true, show: true, alias: "标记备注" },
      { title: "数据查重", icon: "Checked", disabled: true, show: true, alias: "数据查重" },
      { title: "查找替换", icon: "SwitchFilled", disabled: true, show: true, alias: "查找替换" },
      { title: "文件锁定", icon: "Lock", disabled: true, show: true, alias: "文件锁定" },
      { title: "文件解锁", icon: "Unlock", disabled: true, show: true, alias: "文件解锁" },
      { title: "合卷", icon: "Unlock", disabled: true, show: true, alias: "合卷", iconfontIcon: "icon-combining-volumes" },
      { title: "拆卷", icon: "Unlock", disabled: true, show: true, alias: "拆卷", iconfontIcon: "icon-chaijuanfengjuan" },
      { title: "查询归卷", icon: "Unlock", disabled: true, show: true, alias: "查询归卷", iconfontIcon: "icon-cuanhuochaxun" },
      {
        title: "设置标签",
        icon: "Unlock",
        disabled: true,
        show: true,
        alias: "设置标签",
        iconfontIcon: "icon-shezhibiaoqian-01"
      },
      { title: "搜索标签", icon: "Unlock", disabled: true, show: true, alias: "搜索标签", iconfontIcon: "icon-sousuobiaoqian" }
    ]
  },
  {
    title: "导入/导出",
    icon: "Upload",
    iconfontIcon: "icon-daorudaochu",
    list: [
      { title: "前端导出", icon: "Upload", disabled: true, show: true, alias: "前端导出", iconfontIcon: "icon-export" },
      {
        title: "导出归档登记表",
        icon: "Upload",
        disabled: true,
        show: true,
        alias: "导出归档登记表",
        iconfontIcon: "icon-dengjibiaoxiazai"
      },
      {
        title: "导出归档目录清单",
        icon: "Upload",
        disabled: true,
        show: true,
        alias: "导出归档目录清单",
        iconfontIcon: "icon-daochumuluqingdan"
      },
      {
        title: "Excel导入",
        icon: "BottomLeft",
        disabled: true,
        show: true,
        alias: "Excel导入",
        iconfontIcon: "icon-Exceldaoru1"
      },
      { title: "打包", icon: "Download", disabled: true, show: true, alias: "打包", iconfontIcon: "icon-dabao" },
      {
        title: "打包下载全文",
        icon: "Download",
        disabled: true,
        show: true,
        alias: "打包下载全文",
        iconfontIcon: "icon-dabaoxiazai1"
      }
    ]
  },
  {
    title: "二维码",
    icon: "QrcodeOutlined",
    list: [
      { title: "目录二维码", icon: "QrcodeOutlined", disabled: true, show: true, alias: "目录二维码" },
      {
        title: "数据二维码",
        icon: "QrcodeOutlined",
        disabled: true,
        show: true,
        alias: "数据二维码",
        iconfontIcon: "icon-erweima1688"
      }
    ]
  },
  { title: "新增", icon: "FolderAdd", disabled: true, show: true, alias: "新增" },
  { title: "修改", icon: "Edit", disabled: true, show: true, alias: "修改" },
  { title: "删除", icon: "Delete", disabled: true, show: true, alias: "删除" },
  { title: "克隆", icon: "DocumentCopy", disabled: true, show: true, alias: "克隆", iconfontIcon: "icon-kelong1" },
  { title: "复制", icon: "CopyDocument", disabled: true, show: true, alias: "复制", iconfontIcon: "icon-fuzhi" },
  { title: "粘贴", icon: "Document", disabled: true, show: true, alias: "粘贴", iconfontIcon: "icon-paste" },
  { title: "剪贴", icon: "DocumentChecked", disabled: true, show: true, alias: "剪贴", iconfontIcon: "icon-jiantie" },
  { title: "修改分类", icon: "Tickets", disabled: true, show: true, alias: "修改分类", iconfontIcon: "icon-xiugaifenlei2" },
  { title: "流水操作", icon: "Sort", disabled: true, show: false, alias: "流水操作", iconfontIcon: "icon-liushuihao" },
  {
    title: "小流水操作",
    icon: "Sort",
    disabled: true,
    show: false,
    alias: "小流水操作",
    iconfontIcon: "icon-liushuihaoguize"
  },
  // {
  //   title: "流水",
  //   icon: "Sort",
  //   list: [
  //     // { title: "重置大流水", icon: "Sort", disabled: true, show: false, alias: "重置大流水" },
  //     // { title: "大流水上移", icon: "Sort", disabled: true, show: false, alias: "大流水上移" },
  //     // { title: "大流水下移", icon: "Sort", disabled: true, show: false, alias: "大流水下移" },
  //     // { title: "大流水移至", icon: "Sort", disabled: true, show: false, alias: "大流水移至" },
  //     // { title: "重置小流水", icon: "Sort", disabled: true, show: false, alias: "重置小流水" },
  //     // { title: "小流水上移", icon: "Sort", disabled: true, show: false, alias: "小流水上移" },
  //     // { title: "小流水下移", icon: "Sort", disabled: true, show: false, alias: "小流水下移" },
  //     // { title: "小流水移至", icon: "Sort", disabled: true, show: false, alias: "小流水移至" }
  //     { title: "流水号操作", icon: "Sort", disabled: true, show: false, alias: "小流水移至" }
  //   ]
  // },
  {
    title: "流程",
    icon: "Sort",
    iconfontIcon: "icon-liucheng",
    list: [
      {
        title: "数据提交",
        icon: "Sort",
        disabled: true,
        show: false,
        alias: "数据提交",
        iconfontIcon: "icon-bianjitubiao_tijiaoshuju"
      },
      { title: "数据撤回", icon: "Sort", disabled: true, show: false, alias: "数据撤回", iconfontIcon: "icon-shujuchehui" },
      { title: "数据接收", icon: "Sort", disabled: true, show: false, alias: "数据接收", iconfontIcon: "icon-shujujieshou" },
      { title: "撤销接收", icon: "Sort", disabled: true, show: false, alias: "撤销接收", iconfontIcon: "icon-chehuiqianyue" },
      { title: "数据退回", icon: "Sort", disabled: true, show: false, alias: "数据退回", iconfontIcon: "icon-datacopy" },
      { title: "移交入库", icon: "Sort", disabled: true, show: false, alias: "移交入库", iconfontIcon: "icon-db-import" },
      { title: "撤销入库", icon: "Sort", disabled: true, show: false, alias: "撤销入库", iconfontIcon: "icon-database-x" },
      { title: "入库确认", icon: "Sort", disabled: true, show: false, alias: "入库确认", iconfontIcon: "icon-xierushujuku" },
      { title: "退回整编", icon: "Sort", disabled: true, show: false, alias: "退回整编", iconfontIcon: "icon-tuihui" },
      { title: "数据开放", icon: "Sort", disabled: true, show: false, alias: "数据开放", iconfontIcon: "icon-shujukaifang" },
      { title: "取消开放", icon: "Sort", disabled: true, show: false, alias: "取消开放", iconfontIcon: "icon-6guanbijilu1" }
    ]
  }
];
// 全文按钮集合
export const fulltextButton: IButtonList[] = [
  { title: "打开全文", icon: "FolderOpened", disabled: true, show: true, alias: "打开全文" },
  { title: "挂接全文", icon: "Upload", disabled: true, show: true, alias: "挂接全文" },
  { title: "下载全文", icon: "Download", disabled: true, show: true, alias: "下载全文" },
  { title: "打印全文", icon: "Printer", disabled: true, show: true, alias: "打印全文" },
  { title: "删除全文", icon: "Delete", disabled: true, show: true, alias: "删除全文" },
  { title: "全文OCR", icon: "Ticket", disabled: true, show: true, alias: "全文OCR" },
  { title: "权限管理", icon: "Management", disabled: true, show: true, alias: "权限管理" },
  { title: "档案扫描", icon: "MessageBox", disabled: true, show: true, alias: "档案扫描" },
  { title: "重置", icon: "RefreshRight", disabled: true, show: true, alias: "重置" },
  { title: "重命名", icon: "EditPen", disabled: true, show: true, alias: "重命名" },
  { title: "上移", icon: "Top", disabled: true, show: true, alias: "上移" },
  { title: "下移", icon: "Bottom", disabled: true, show: true, alias: "下移" }
];

// 子级表格按钮集合
export const childButtonList: (IButtonList | IButtonGroup)[] = [
  {
    title: "常用操作",
    icon: "Operation",
    list: [
      { title: "移交下一环节", icon: "SortDown", disabled: true, show: true, alias: "移交下一环节" },
      { title: "退回上一步", icon: "SortUp", disabled: true, show: true, alias: "退回上一步" },
      { title: "批量挂接全文", icon: "Link", disabled: true, show: true, alias: "批量挂接全文" },
      { title: "轨迹查看", icon: "MapLocation", disabled: true, show: true, alias: "轨迹查看" },
      { title: "OCR", icon: "Ticket", disabled: true, show: true, alias: "OCR" },
      { title: "权限管理", icon: "Management", disabled: true, show: true, alias: "权限管理" },
      { title: "离线挂接", icon: "Download", disabled: true, show: true, alias: "离线挂接" },
      { title: "标记备注", icon: "Flag", disabled: true, show: true, alias: "标记备注" },
      { title: "数据查重", icon: "Checked", disabled: true, show: true, alias: "数据查重" },
      { title: "查找替换", icon: "SwitchFilled", disabled: true, show: true, alias: "查找替换" },
      { title: "文件锁定", icon: "Lock", disabled: true, show: true, alias: "文件锁定" },
      { title: "文件解锁", icon: "Unlock", disabled: true, show: true, alias: "文件解锁" },
      { title: "合卷", icon: "Unlock", disabled: true, show: true, alias: "合卷", iconfontIcon: "icon-combining-volumes" },
      { title: "拆卷", icon: "Unlock", disabled: true, show: true, alias: "拆卷", iconfontIcon: "icon-chaijuanfengjuan" },
      { title: "查询归卷", icon: "Unlock", disabled: true, show: true, alias: "查询归卷", iconfontIcon: "icon-cuanhuochaxun" },
      {
        title: "设置标签",
        icon: "Unlock",
        disabled: true,
        show: true,
        alias: "设置标签",
        iconfontIcon: "icon-shezhibiaoqian-01"
      },
      { title: "搜索标签", icon: "Unlock", disabled: true, show: true, alias: "搜索标签", iconfontIcon: "icon-sousuobiaoqian" }
    ]
  },
  {
    title: "导入/导出",
    icon: "Upload",
    iconfontIcon: "icon-daorudaochu",
    list: [
      { title: "前端导出", icon: "Upload", disabled: true, show: true, alias: "前端导出", iconfontIcon: "icon-export" },
      {
        title: "导出归档登记表",
        icon: "Upload",
        disabled: true,
        show: true,
        alias: "导出归档登记表",
        iconfontIcon: "icon-dengjibiaoxiazai"
      },
      {
        title: "导出归档目录清单",
        icon: "Upload",
        disabled: true,
        show: true,
        alias: "导出归档目录清单",
        iconfontIcon: "icon-daochumuluqingdan"
      },
      {
        title: "Excel导入",
        icon: "BottomLeft",
        disabled: true,
        show: true,
        alias: "Excel导入",
        iconfontIcon: "icon-Exceldaoru1"
      },
      { title: "打包", icon: "Download", disabled: true, show: true, alias: "打包", iconfontIcon: "icon-dabao" },
      {
        title: "打包下载全文",
        icon: "Download",
        disabled: true,
        show: true,
        alias: "打包下载全文",
        iconfontIcon: "icon-dabaoxiazai1"
      }
    ]
  },
  {
    title: "二维码",
    icon: "QrcodeOutlined",
    list: [
      { title: "目录二维码", icon: "QrcodeOutlined", disabled: true, show: true, alias: "目录二维码" },
      { title: "数据二维码", icon: "QrcodeOutlined", disabled: true, show: true, alias: "数据二维码" }
    ]
  },
  { title: "新增", icon: "FolderAdd", disabled: true, show: true, alias: "新增" },
  { title: "修改", icon: "Edit", disabled: true, show: true, alias: "修改" },
  { title: "删除", icon: "Delete", disabled: true, show: true, alias: "删除" },
  { title: "克隆", icon: "DocumentCopy", disabled: true, show: true, alias: "克隆", iconfontIcon: "icon-kelong1" },
  { title: "复制", icon: "CopyDocument", disabled: true, show: true, alias: "复制", iconfontIcon: "icon-fuzhi" },
  { title: "粘贴", icon: "Document", disabled: true, show: true, alias: "粘贴", iconfontIcon: "icon-paste" },
  { title: "剪贴", icon: "DocumentChecked", disabled: true, show: true, alias: "剪贴", iconfontIcon: "icon-jiantie" },
  { title: "修改分类", icon: "Tickets", disabled: true, show: true, alias: "修改分类", iconfontIcon: "icon-xiugaifenlei2" },
  { title: "流水操作", icon: "Sort", disabled: true, show: false, alias: "流水操作", iconfontIcon: "icon-liushuihao" },
  { title: "小流水操作", icon: "Sort", disabled: true, show: false, alias: "小流水操作", iconfontIcon: "icon-liushuihaoguize" },
  // {
  //   title: "流水",
  //   icon: "Sort",
  //   list: [
  //     { title: "重置大流水", icon: "Sort", disabled: true, show: false, alias: "重置大流水" },
  //     { title: "大流水上移", icon: "Sort", disabled: true, show: false, alias: "大流水上移" },
  //     { title: "大流水下移", icon: "Sort", disabled: true, show: false, alias: "大流水下移" },
  //     { title: "大流水移至", icon: "Sort", disabled: true, show: false, alias: "大流水移至" },
  //     { title: "重置小流水", icon: "Sort", disabled: true, show: false, alias: "重置小流水" },
  //     { title: "小流水上移", icon: "Sort", disabled: true, show: false, alias: "小流水上移" },
  //     { title: "小流水下移", icon: "Sort", disabled: true, show: false, alias: "小流水下移" },
  //     { title: "小流水移至", icon: "Sort", disabled: true, show: false, alias: "小流水移至" }
  //   ]
  // },
  {
    title: "流程",
    icon: "Sort",
    iconfontIcon: "icon-liucheng",
    list: [
      {
        title: "数据提交",
        icon: "Sort",
        disabled: true,
        show: false,
        alias: "数据提交",
        iconfontIcon: "icon-bianjitubiao_tijiaoshuju"
      },
      { title: "数据撤回", icon: "Sort", disabled: true, show: false, alias: "数据撤回", iconfontIcon: "icon-shujuchehui" },
      { title: "数据接收", icon: "Sort", disabled: true, show: false, alias: "数据接收", iconfontIcon: "icon-shujujieshou" },
      { title: "数据退回", icon: "Sort", disabled: true, show: false, alias: "数据退回", iconfontIcon: "icon-chehuiqianyue" },
      { title: "撤销接收", icon: "Sort", disabled: true, show: false, alias: "撤销接收", iconfontIcon: "icon-datacopy" },
      { title: "移交入库", icon: "Sort", disabled: true, show: false, alias: "移交入库", iconfontIcon: "icon-db-import" },
      { title: "入库确认", icon: "Sort", disabled: true, show: false, alias: "入库确认", iconfontIcon: "icon-database-x" },
      { title: "撤销入库", icon: "Sort", disabled: true, show: false, alias: "撤销入库", iconfontIcon: "icon-xierushujuku" },
      { title: "入库退回", icon: "Sort", disabled: true, show: false, alias: "入库退回", iconfontIcon: "icon-tuihui" },
      { title: "数据开放", icon: "Sort", disabled: true, show: false, alias: "数据开放", iconfontIcon: "icon-shujukaifang" },
      { title: "取消开放", icon: "Sort", disabled: true, show: false, alias: "取消开放", iconfontIcon: "icon-6guanbijilu1" }
    ]
  }
];
/*
 * 用于权限处理,获取数组list
 *
 */
export const getButtonList = () => {
  const arr: any[] = [];
  buttonList.forEach(item => {
    if (item.list) {
      item.list.forEach(item2 => {
        arr.push(item2.title);
      });
    } else {
      arr.push(item.title);
    }
  });
  return [...new Set(arr)];
};
export const getFulltextList = () => {
  const arr: any[] = [];
  fulltextButton.forEach(item => {
    arr.push(item.title);
  });
  return [...new Set(arr)];
};
export const getChildButtonList = () => {
  const arr: any[] = [];
  // childButtonList.forEach(item => {
  //   arr.push(item.title);
  // });
  childButtonList.forEach(item => {
    if (item.list) {
      item.list.forEach(item2 => {
        arr.push(item2.title);
      });
    } else {
      arr.push(item.title);
    }
  });
  return [...new Set(arr)];
};
